package uscdb.model;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

@Entity
@Table(name = "treview")
@DynamicInsert(true)
@DynamicUpdate(true)
public class Treview implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -6228444600255691637L;
	private String id;

	/**
	 * review的任务名称
	 */
	private String name;

	/**
	 * 这个任务的发起者，Excel里面的回复者默认是review发起者
	 */
	private String reviewOwner = "";

	/**
	 * 该review的评审总数量
	 */
	private Integer totalNum = 0;

	/**
	 * 一个review有多个用户
	 */
	private Set<Tusertreview> tusertreviewSet = new HashSet<Tusertreview>();

	/**
	 * review的类型，有脚本review-1，用例review-2，方案review-3
	 */
	private String type;

	/**
	 * 该任务上传多少次，以防造假
	 */
	private Integer times;

	@Id
	@Column(name = "ID", nullable = false, length = 36)
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@Column(name = "NAME", nullable = false, length = 100)
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "totalNum")
	public Integer getTotalNum() {
		return totalNum;
	}

	public void setTotalNum(Integer totalNum) {
		this.totalNum = totalNum;
	}


	@Column(name = "type", nullable = false, length = 10)
	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	@Column(name = "reviewOwner", nullable = false, length = 100)
	public String getReviewOwner() {
		return reviewOwner;
	}

	public void setReviewOwner(String reviewOwner) {
		this.reviewOwner = reviewOwner;
	}

	@Column(name = "times")
	public Integer getTimes() {
		return times;
	}

	public void setTimes(Integer times) {
		this.times = times;
	}

	public Treview() {
		super();
	}

	public Treview(String id, String name, String type, Integer times) {
		super();
		this.id = id;
		this.name = name;
		this.type = type;
		this.times = times;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "treview")
	public Set<Tusertreview> getTusertreviewSet() {
		return tusertreviewSet;
	}

	public void setTusertreviewSet(Set<Tusertreview> tusertreviewSet) {
		this.tusertreviewSet = tusertreviewSet;
	}

	
	
}
